# coding:UTF-8
# ________________________
# Project_Name:pythonProject
# File_Name:Administrator
# Author:Administrator
# Date_Time:2022/4/22 16:57
# Description:
# ________________________
from selenium import webdriver
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys



def  foo1():
    """"

    """
    driver = webdriver.Chrome()
    driver.maximize_window()
    driver.get(r"http://news.baidu.com/")
    #翻页操作
    driver.find_element(By.XPATH,"/html").send_keys(Keys.PAGE_DOWN)

    for i in range(10):
      driver.find_element(By.XPATH,"/html").send_keys(Keys.PAGE_UP)
      time.sleep(2)

    #组合按键
    driver.find_element(By.XPATH, "/html").send_keys(Keys.CONTROL,"a")

    time.sleep(2)


    driver.quit()




if  __name__=="__main__":
    foo1()
